/*
 * @Author: TC(tengchao@taqu.cn)
 * @Date: 2025-11-11 10:30:25
 * @Last Modified by: TC(tengchao@taqu.cn)
 * @Last Modified time: 2025-11-11 10:31:32
 */
import { _decorator, Component, director, MeshRenderer, Node, RenderTexture } from "cc";
const { ccclass, property } = _decorator;

@ccclass("ShaderCaseDepth")
export class ShaderCaseDepth extends Component {
    @property(RenderTexture)
    renderTexture: RenderTexture;

    start() {
        const material = this.node.getComponent(MeshRenderer).getMaterialInstance(0);
        const depthTexture = this.renderTexture.window.framebuffer.depthStencilTexture;
        material.setProperty("depthTexture", depthTexture);
        // const pass0 = material.passes[0];
        // const bindingIndex = pass0.getBinding("depthTexture");
        // pass0.bindSampler(bindingIndex, director.root.pipeline.globalDSManager.pointSampler);
    }
}
